<include file="Common:header" />
<div class="layui-card layadmin-header"> <span class="layui-breadcrumb" lay-filter="menu" lay-separator="/"> <a href="{:U('Index/welcome')}">首页</a><a href="javascript:;">常用工具</a> <a href="{:U('Tools/mailTO')}">发送邮件</a> </span> </div>

<div class="layui-fluid pt-10 pr-10 pl-20 pt-20">
	<form class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label">发送给</label>
			<div class="layui-input-block">
				<input type="text" id="email" lay-verify="email" placeholder="请输入邮箱地址" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">标题</label>
			<div class="layui-input-block">
				<input type="text" id="title" lay-verify="required" placeholder="请输入标题。" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">内容</label>
			<div class="layui-input-block">
				<input type="text" id="content" lay-verify="required" placeholder="请输入内容。" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<a href="javascript:;" class="layui-btn" id="send">发送邮件</a>
			</div>
		</div>
	</form>
</div>
<hr>
<div class="layui-fluid pt-10 pr-10 pl-20 pt-20" style="padding-left:100px" id="result"></div>
<script>
layui.use('element', function(){
	var $ = layui.$;
	$('#send').on('click','',function(){
		var content = $('#content').val()
			,email = $('#email').val()
			,title = $('#title').val();
		if(!content || !email|| !title){
			alert('必填项不能为空！');
			return;
		}
		$.post("{:U('Tools/mailTo')}",{title:title,content:content,email:email},function(result){
			$("#result").html(result.html);
		});
	})
});
</script>
<include file="Common:footer" />